/**
 *@Project:SocialTag
 *@Package:data
 *@Name:EuclideanDistance.java
 *@Author:yexijiang
 *@Date:Jul 6, 2008
 *@Decription:
 */
package data;

import java.util.Vector;

/**
 */
public class EuclideanDistance extends Distance
{

	@Override
	/**
	 * The Euclidean distance between two vectors
	 */
	public double distance(Vector<Double> v1, Vector<Double> v2)
	{
		double distance = 0.0;
		for(int i = 0; i < v1.size(); ++i)
		{
			distance += Math.pow(v1.get(i) - v2.get(i), 2);
		}
		
		distance = Math.sqrt(distance);
		
		return distance;
	}
	
}
